package ru.ksu.ktk.diploma.sdi.analyzer;

import java.util.List;

/**
 * This class represents part of the table row (tuple) - pair of values this row includes
 * 
 * @author coldflame 23.04.2009 15:16:24
 */
public class FieldPair {
    /**
     * id or number of row
     */
    private int id;
    /**
     * list of thesauri descriptors which corresponds to first field of pair
     */
    private List<String> firstFieldList;
    /**
     * list of thesauri descriptors which corresponds to second field of pair
     */
    private List<String> secondFieldList;

    public FieldPair(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public List<String> getFirstFieldList() {
        return firstFieldList;
    }

    public void setFirstFieldList(List<String> firstFieldList) {
        this.firstFieldList = firstFieldList;
    }

    public List<String> getSecondFieldList() {
        return secondFieldList;
    }

    public void setSecondFieldList(List<String> secondFieldList) {
        this.secondFieldList = secondFieldList;
    }

    @Override
    public String toString() {
        StringBuilder firstSb = new StringBuilder();
        for (String str : firstFieldList){
            firstSb.append(str);
            firstSb.append(" ");
        }
        StringBuilder secondSb = new StringBuilder();
        for (String str : secondFieldList){
            secondSb.append(str);
            secondSb.append(" ");
        }
        return String.format("%d | %s | %s", id, firstSb.toString(), secondSb.toString());
    }
}
